package org.example.maven.pojo.department.list;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class DepartmentListTable {
    private String id;
    private String deptName;
    private Integer status;
    private String parentId;
    private LocalDateTime createTime;
    private String realName;
    private Integer isDeleted;
    List<DepartmentListTable> children;

    public DepartmentListTable(String id,String deptName,Integer status,LocalDateTime createdAt,String parentId,String realName){
        this.id=id;
        this.deptName=deptName;
        this.status=status;
        this.createTime=createdAt;
        this.parentId=parentId;
        this.realName=realName;
        this.children= new ArrayList<>();
    }

    private void addChildren(DepartmentListTable departmentListTable){
        this.children.add(departmentListTable);
    }
}
